package com.lagou.rpc.consumer;

import com.lagou.rpc.consumer.proxy.NettyConnection;
import com.lagou.rpc.consumer.util.ZkUtil;

import java.util.Map;

/**
 * 测试类
 */
public class ClientBootStrap {
    public static void main(String[] args) {
//        IUserService userService = (IUserService) RpcClientProxy.createProxy(IUserService.class);
//        User user = userService.getById(1);
//        System.out.println(user);

        //获取zk连接
        ZkUtil zkUtil = new ZkUtil();
        zkUtil.connect();
        //从zk上获取连接的ip和port
        Map<String, String> hostAndNodeMap = zkUtil.getChildrenHost(false);
        NettyConnection.createConnection(hostAndNodeMap);

        try {
            Thread.sleep(100000);
        } catch (Exception e) {

        }


    }
}
